//
//  UIColor+Extension.m
//  LiTingFeng
//
//  Created by xinxuan on 16/1/15.
//  Copyright © 2016年 Bullgo. All rights reserved.
//

#import "UIColor+Extension.h"

@implementation UIColor (Extension)

+ (UIColor *)colorFromHex:(int)hex
{
    return [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16))/255.0
                           green:((float)((hex & 0xFF00) >> 8))/255.0
                            blue:((float)(hex & 0xFF))/255.0 alpha:1.0];
}

+ (UIColor *)colorFromHex:(int)hex withAlpha:(CGFloat)alpha
{
    return [[UIColor colorFromHex:hex] colorWithAlphaComponent:alpha];
}

@end
